package com.hackintosh.bus;

/**
 * @description：
 * @author：twislyn
 * @date：Created in 2021/06/06
 * @modified By：
 * @version: 1.0
 */
public class AndExpression implements Expression {
    private Expression city;

    private Expression person;

    public AndExpression(Expression city, Expression person) {
        this.city = city;
        this.person = person;
    }

    @Override
    public boolean interpret(String info) {
        String[] data = info.split("的");
        return city.interpret(data[0]) && person.interpret(data[1]);
    }
}
